import request from '@/utils/request'

export default {
    /**
     * banner列表（条件查询分页）
     * @param {当前页} current 
     * @param {每页记录数} size 
     * @returns banner分页列表
     */
    getBannerListPage(current, size) {
        return request({
            url: `/cmsservice/banner-admin/pageBannerCondition/${current}/${size}`,
            method: 'post'
          })
    },
    /**
     * 根据bannerid删除banner信息
     * @param {bannerid} id 
     * @returns 
     */
    deleteBannerById(id) {
        return request({
            url: `/cmsservice/banner-admin/remove/${id}`,
            method: 'delete'
          })
    },
    /**
     * 添加banner
     * @param {banner对象} banner 
     * @returns 
     */
    addBanner(banner) {
        return request({
            url: `/cmsservice/banner-admin/addBanner`,
            method: 'post',
            data: banner
          })
    },
    /**
     * 根据bannerid查询banner信息
     * @param {bannerid} id 
     * @returns banner对象
     */
    getBannerById(id) {
        return request({
            url: `/cmsservice/banner-admin/getBanner/${id}`,
            method: 'get'
          })
    },
    /**
     * @param {banner对象} banner 
     * @returns 
     */
    updateBanner(banner) {
        return request({
            url: `/cmsservice/banner-admin/updateBanner`,
            method: 'post',
            data: banner
          })
    }
}
